package io.kiki.stack.netty.protocol;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Setter
@Getter
public class DeserializeLevel {


    /**
     * deserialize only the clazz part of rpc command
     */
    public final static int deserialize_clazz = 0x00;
    /**
     * deserialize both header and clazz parts of rpc command
     */
    public final static int deserialize_header = 0x01;
    /**
     * deserialize clazz, header, contents all three parts of rpc command
     */
    public final static int deserialize_all = 0x02;

    public static String valueOf(int value) {
        switch (value) {
        case 0x00:
            return "deserialize_clazz";
        case 0x01:
            return "deserialize_header";
        case 0x02:
            return "deserialize_all";
        }
        throw new IllegalArgumentException("Unknown deserialize level value ," + value);
    }
}